package com.tjn.exercise;

public class Factory {
    private static Horse horse = new Horse();

    private Factory() {
    }

    public static Horse getHorse() {//用static可以直接用类名去调用
        return horse;
    }
    public static Boat getBoat() {
        return new Boat();
    }
}
